package bestdreamer;

public class MainClass {


   public static void main(String[] args) {
        // 获得 AppleFactory
       FruitFactory af = new AppleFactory();
       Fruit apple = af.getFruit();
       apple.get();

       // 获得 BananaFactory
       FruitFactory bf = new BananaFactory();
       Fruit banana = bf.getFruit();
       banana.get();

       // 获得 PearFactory
       FruitFactory pf = new PearFactory();
       Fruit pear = pf.getFruit();
       pear.get();

   }
}
